package com.kcs.fxmargin.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.kcs.common.utils.commonUtils;
import com.kcs.fxmargin.bo.ListOfForwardContractBO;
import com.kcs.fxmargin.export.excel.ListOfForwardContractExcel;
import com.kcs.fxmargin.export.model.ReportCriteria;

public class ExportService {
	 private ReportCriteria reportCriteria = null;
	 public byte[] genListOfForwardContract(List<ListOfForwardContractBO> fcList, String cifNo, String customerName, String asOfDate, String userName){
		 byte[] result = null;
		 reportCriteria = new ReportCriteria();
		 reportCriteria.setLeftFooter(userName);
		 Map headerTable = new HashMap();
		 headerTable.put("CIF_NO", cifNo);
		 headerTable.put("CUSTOMER_NAME", customerName);
		 headerTable.put("AS_OF_DATE", asOfDate);
		 reportCriteria.setHeaderTable(headerTable);
		 try {
	         if (commonUtils.isNotEmpty(fcList)) {
	        	 ListOfForwardContractExcel generator = new ListOfForwardContractExcel();	
				 result = generator.generateExcel(fcList, reportCriteria);				
	         }		 
		 } catch (Exception e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
		 }
		 return result;
	 }
}
